package com.ctshk.sapp.goods.controller;


import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.rpc.goods.dto.RegionalFreightDTO;
import com.ctshk.rpc.goods.service.IRegionalFreightService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import com.ctshk.common.dto.Result;

import com.ctshk.common.web.support.BaseController;

import java.util.List;

/**
 * <p>
 * 地区运费表 前端控制器
 * </p>
 *
 * @author 姜斌文
 * @since 2021-04-09
 */
@Api(value = "模板运费详情", tags = "模板运费详情")
@RestController
@RequestMapping("/regional/freight")
public class RegionalFreightController extends BaseController {

    @DubboReference
    IRegionalFreightService regionalFreightService;

    @ApiOperation(value = "根据模板ID查询运费列表", notes = "根据模板ID查询运费列表")
    @OperationLogAnnotation(operModul = OperationLogModel.GOODS, operType = OperationLogType.QUERY, operTitle = "根据模板ID查询运费列表", operDesc = "根据模板ID查询运费列表")
    @GetMapping("/findRegionalFreightListByTemplateId/{templateId}")
    public Result<List<RegionalFreightDTO>> findRegionalFreightListByTemplateId(@PathVariable("templateId") Long templateId){
        List<RegionalFreightDTO> regionalFreightDTOS = regionalFreightService.findRegionalFreightListByTemplateId(templateId);
        return Result.success(regionalFreightDTOS);
    }
}
